﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace HiTeachers.Services.Exceptions
{
    [Serializable]
    public class BusinessException : ApplicationException
    {
        private int _errorCode;

        public BusinessException(SerializationInfo info, StreamingContext context)
            : base(info, context) { }

        public BusinessException(string message)
            : base(message)
        {
        }

        public BusinessException(string message, int errorCode)
            : base(message)
        {
            _errorCode = errorCode;
        }

        public BusinessException(string message, Exception innerException)
            : base(message, innerException)
        {
        }

        public BusinessException(string message, Exception innerException, int errorCode)
            : base(message, innerException)
        {
            _errorCode = errorCode;
        }

        public int ErrorCode
        {
            get { return _errorCode; }
            set { _errorCode = value; }
        }
    }
}
